package com.zwj.service.impl;


import com.zwj.dao.ByAppinfo.ByAppinfoMapper;
import com.zwj.pojo.AppInfo;
import com.zwj.service.ByAppinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ByAppinfoServiceimpl implements ByAppinfoService {
    @Autowired
 private ByAppinfoMapper byAppinfoMapper;

    @Override
    public List<AppInfo> getAppInfoList(String querySoftwareName, Integer queryCategoryLevel1, Integer queryCategoryLevel2, Integer queryCategoryLevel3, Integer queryFlatformId, Integer currentPageNo, Integer pageSize) {
        return byAppinfoMapper.getAppInfoList(querySoftwareName, 1, queryCategoryLevel1, queryCategoryLevel2,
                queryCategoryLevel3, queryFlatformId, null, (currentPageNo-1)*pageSize, pageSize);
    }

    @Override
    public int getAppInfoCount(String querySoftwareName, Integer queryCategoryLevel1, Integer queryCategoryLevel2, Integer queryCategoryLevel3, Integer queryFlatformId) {
        return byAppinfoMapper.getAppInfoCount(querySoftwareName, 1, queryCategoryLevel1, queryCategoryLevel2,
                queryCategoryLevel3, queryFlatformId, null);
    }

    @Override
    public AppInfo getAppBySelect(int vid, int iid) {
        return byAppinfoMapper.getAppBySelect(vid,iid);
    }

    @Override
    public boolean updateSatus(Integer status, Integer id) {
        boolean flag = false;
        if(byAppinfoMapper.updateSatus(status, id) > 0 ){
            flag = true;
        }
        return flag;
    }

//    @Override
//    public List<Appinfo> selectList(String softwareName, String APKName, String flatformName, String categoryLevel1Name, String categoryLevel2Name, String categoryLevel3Name, String statusName, String softwareSize, String downloads, String versionNo) {
//        return byAppinfoMapper.selectList(softwareName,APKName,flatformName,categoryLevel1Name,categoryLevel2Name,categoryLevel3Name,statusName,softwareSize,downloads,versionNo);
//    }
}
